import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

/**
 * 查询字段
 */
export const searchFormSchema: FormSchema[] = [
  {
    label: '报关单号',
    field: 'customsDeclarationNumber',
    component: 'JInput',
    colProps: { span: 6 },
    componentProps: {
      type: '',
    },
  },
  {
    label: '商品名称',
    field: 'productName',
    component: 'JInput',
    colProps: { span: 6 },
    componentProps: {
      type: '',
    },
  },
  {
    label: '起运地',
    field: 'pointOfOrigin',
    component: 'JInput',
    colProps: { span: 6 },
    componentProps: {
      type: '',
    },
  },
  {
    field: 'timeOfDeparture',
    component: 'RangePicker',
    label: '起运时间',
    componentProps: {
      valueType: 'Date',
    },
    colProps: {
      span: 6,
    },
  },
  {
    field: 'estimatedTime',
    component: 'RangePicker',
    label: '到港时间',
    componentProps: {
      valueType: 'Date',
    },
    colProps: {
      span: 6,
    },
  },
];
/**
 * 表格数据
 */
export const columns: BasicColumn[] = [
  {
    title: '序号',
    dataIndex: '',
    key: 'rowIndex',
    width: 60,
    align: 'center',
    customRender: ({ index }) => {
      return parseInt(index) + 1;
    },
  },
  {
    title: '报关单号',
    dataIndex: 'customsDeclarationNumber', //字段不对
    width: 120,
  },
  {
    title: '商品名称',
    dataIndex: 'productName',
    width: 100,
  },
  {
    title: '英文名',
    dataIndex: 'englishName',
    width: 120,
  },
  {
    title: '起运地',
    dataIndex: 'pointOfOrigin',
    width: 80,
  },
  {
    title: '起运时间',
    dataIndex: 'timeOfDeparture',
    width: 100,
  },
  {
    title: '到港时间',
    dataIndex: 'estimatedTime',
    width: 100,
  },
  {
    title: '查验时间',
    width: 150,
    dataIndex: 'inspectionTime',
  },
  {
    title: '实验室检测时间',
    width: 150,
    dataIndex: 'processingTime',
  },
  {
    title: '吨位',
    dataIndex: 'tonnage',
    width: 80,
  },
];
/**
 * 表单数据
 */
export const formSchema: FormSchema[] = [
  {
    label: '报关单号',
    field: 'customsDeclarationNumber',
    component: 'Input',
  },
  {
    label: '商品名称',
    field: 'productName',
    component: 'Input',
  },
  {
    label: '英文名',
    field: 'englishName',
    component: 'Input',
  },
  {
    label: '起运地',
    field: 'pointOfOrigin',
    component: 'Input',
  },
  {
    label: '起运时间',
    field: 'timeOfDeparture',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    label: '到港时间',
    field: 'estimatedTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    label: '查验时间',
    field: 'inspectionTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    label: '实验室检测时间',
    field: 'processingTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    label: '吨位',
    field: 'tonnage',
    component: 'Input',
  },
];
